// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class example09_ue4 : ModuleRules
{
	public example09_ue4(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[]
		{ "Core", "CoreUObject", "Engine", "InputCore", "RHI", "RenderCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true

		BuildWithOpenCV("E:/Engines/OpenCV_Builds/4.6.0", "vc15", "460", true);
	}

	public void BuildWithOpenCV(string rootPath, string vc, string ver, bool withWorld)
	{
		string vcLib = rootPath + "/x64/" + vc + "/lib/";
		string vcBin = rootPath + "/x64/" + vc + "/bin/";
		PublicIncludePaths.Add(rootPath + "/include");

		if (withWorld)
		{
			PublicAdditionalLibraries.Add(vcLib + "opencv_world" + ver + ".lib");
			PublicDelayLoadDLLs.Add("opencv_world" + ver + ".dll");
		}
		else
		{
			PublicAdditionalLibraries.Add(vcLib + "opencv_core" + ver + ".lib");
			PublicAdditionalLibraries.Add(vcLib + "opencv_highgui" + ver + ".lib");
			PublicAdditionalLibraries.Add(vcLib + "opencv_imgproc" + ver + ".lib");
			PublicAdditionalLibraries.Add(vcLib + "opencv_imgcodecs" + ver + ".lib");
			PublicAdditionalLibraries.Add(vcLib + "opencv_videoio" + ver + ".lib");

			PublicDelayLoadDLLs.Add("opencv_core" + ver + ".dll");
			PublicDelayLoadDLLs.Add("opencv_highgui" + ver + ".dll");
			PublicDelayLoadDLLs.Add("opencv_imgproc" + ver + ".dll");
			PublicDelayLoadDLLs.Add("opencv_imgcodecs" + ver + ".dll");
			PublicDelayLoadDLLs.Add("opencv_videoio" + ver + ".dll");
		}
	}
}
